<template>
  <a-card :bordered='false'>
    <!-- 查询区域 -->
    <div class='table-page-search-wrapper'>
      <a-form layout='inline' @keyup.enter.native='searchQuery'>
        <a-row :gutter='24'>
          <a-col :span='16'>
            <a-form-model-item label='年级' prop='queryParam.gradeId'>
              <s-dict-select-tag v-model='queryParam.gradeId' @change='changeGradeId' placeholder='请选择年级'
                                 dictCode='cou_grade,grade_name,id,tenant_id  is not null order by  grade_order' />
            </a-form-model-item>
          </a-col>

          <a-col :span='8'>
            <a-form-model-item label='届级' prop='queryParam.studentEnrollmentYear'>
              <s-dict-select-tag v-model='queryParam.studentEnrollmentYear' placeholder='请选择届级'
                                 dictCode='cou_gradesession_year,gradesession_year_name,gradesession_year_code,iz_open=1 and del_flag=0 order by  gradesession_year_code' />
            </a-form-model-item>
          </a-col>
        </a-row>

        <!-- 折叠部分-->
        <template v-if='toggleSearchStatus'>
          <a-row :gutter='24' style='height: 85px'>
            <a-col>
              <a-form-model-item label='班级' prop='queryParam.classId'>
                <s-multi-select-tag :isPinYin='isPinYin' placeholder='请选择班级' v-model='queryParam.classId'
                                    :dictCode='this.queryParamSelect.classIdSelect' />
              </a-form-model-item>
            </a-col>
          </a-row>

          <a-row :gutter='24'>
            <a-col :xl='3' :lg='7' :md='8' :sm='24'>
              <a-form-item label='学号'>
                <a-input placeholder='请输入学生学号' v-model='queryParam.studentNo'></a-input>
              </a-form-item>
            </a-col>


            <a-col :xl='4' :lg='7' :md='8' :sm='24'>
              <a-form-item label='学生姓名'>
                <a-input placeholder='请输入学生姓名' v-model='queryParam.studentName'></a-input>
              </a-form-item>
            </a-col>

            <a-col :xl='3' :lg='7' :md='8' :sm='24'>
              <a-form-model-item label='部门' prop='queryParam.sysOrgCode'>
                <j-select-depart v-model='queryParam.sysOrgCode' :trigger-change='true' customReturnField='orgCode'
                                 :multi='true'></j-select-depart>
              </a-form-model-item>
            </a-col>
            <a-col :xl='4' :lg='7' :md='8' :sm='24'>
              <a-form-item label='身份证号'>
                <a-input placeholder='请输入身份证号' v-model='queryParam.studentNo'></a-input>
              </a-form-item>
            </a-col>

            <a-col :xl='4' :lg='7' :md='8' :sm='24'>
              <a-form-item label='IC卡号'>
                <a-input placeholder='请输入IC卡号' v-model='queryParam.studentCardNo'></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="8">
              <a-form-model-item label="忽略">
                <j-checkbox
                  v-model="queryParam.ignoreProperty"
                  :options="queryParamSelect.ignorePropertyList"
                />
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter='24'>
            <a-col style='height: 75px'>
              <a-form-model-item style='overflow-y: scroll;height: 80px;' label='导入批次' prop='queryParam.batchNumber'>
                <s-dict-select-tag  placeholder='请选择导入批次' v-model='queryParam.batchNumber' :options='batchNumbers' />
              </a-form-model-item>
            </a-col>

          </a-row>
        </template>
        <a-row :gutter='24' style='margin-top: 10px'>
          <!-- 查询按钮 -->
          <a-col :offset='8'>
            <span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
              <a-button type='primary' @click='searchQuery' icon='search'>查询</a-button>
              <a-button type='primary' @click='searchReset' icon='reload' style='margin-left: 8px'>重置</a-button>
              <a @click='handleToggleSearch' style='margin-left: 8px'>
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
              </a>
            </span>
          </a-col>

        </a-row>

      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class='table-operator'>
      <a-button @click='handleAdd' type='primary' icon='plus'>新增</a-button>
      <a-button type='primary' icon='download' @click="handleExportXlsDemo('学生信息导入模板')">下载模板文件</a-button>
      <a-button type='primary' icon='download' @click="handleExportXls('stu_student')">导出</a-button>
      <a-upload name='file' :showUploadList='false' :multiple='false' :headers='tokenHeader' :action='importExcelUrl'
                @change='handleImportExcel'>
        <a-button type='primary' icon='import'>导入</a-button>
      </a-upload>
      <!-- 高级查询区域 -->
      <j-super-query :fieldList='superFieldList' ref='superQueryModal'
                     @handleSuperQuery='handleSuperQuery'></j-super-query>
      <a-dropdown v-if='selectedRowKeys.length > 0'>
        <a-menu slot='overlay'>
          <a-menu-item key='3' @click='changeSysOrgCodeVisible = true'>
            <a-icon type='add' />
            批量调整部门
          </a-menu-item>
          <a-menu-item key='2' @click='addUsersVisible = true'>
            <a-icon type='add' />
            创建登录账号
          </a-menu-item>
          <a-menu-item key='1' @click='batchDel'>
            <a-icon type='delete' />
            删除
          </a-menu-item>
        </a-menu>
        <a-button style='margin-left: 8px'> 批量操作
          <a-icon type='down' />
        </a-button>
      </a-dropdown>
      <template>
        <span style="float:right;">
          <a @click="searchQuery()"><a-icon type="sync" />刷新</a>
          <a-divider type="vertical" />
          <a-button v-print="'#datatable'" ghost type="primary">打印</a-button>
        </span>
      </template>

      <!-- 创建学生登录账号 信息填充弹窗 -->
      <div>
        <a-modal title='创建学生登录账号' :visible='addUsersVisible' @ok='addUsers()' @cancel='addUsersVisibleCancel'
                 width='40%'>
          <a-row>
            <a-col :span='24'>
              <a-form-model-item label='为学生账号设置统一登录密码' :labelCol='labelCol' :wrapperCol='wrapperCol'
                                 prop='studentAddUsers.stupassword'>
                <a-input v-model='studentAddUsers.stupassword' placeholder='请为新学生用户设置统一登录密码'></a-input>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-modal>
      </div>

      <!-- 批量调整学生所在部门 信息填充弹窗 -->
      <div>
        <a-modal title='批量调整部门' :visible='changeSysOrgCodeVisible' @ok='changeSysOrgCode()'
                 @cancel='changeSysOrgCodeVisibleCancel' width='40%'>
          <a-row>
            <a-col :span='24'>
              <a-form-model-item label='新部门' prop='studentchangeSysOrgCode.sysOrgCode'>
                <j-select-depart v-model='studentchangeSysOrgCode.sysOrgCode' :trigger-change='true'
                                 customReturnField='orgCode' :multi='true'></j-select-depart>
              </a-form-model-item>

              <a-form-model-item label='新届级' prop='studentchangeSysOrgCode.studentEnrollmentYear'>
                <s-dict-select-tag v-model='studentchangeSysOrgCode.studentEnrollmentYear' placeholder='请选择届级'
                                   dictCode='cou_gradesession_year,gradesession_year_name,gradesession_year_code,iz_open=1 and del_flag=0 order by  gradesession_year_code' />

              </a-form-model-item>

              <a-form-model-item label='状态' prop='studentchangeSysOrgCode.studentStatus'>
                <s-dict-select-tag v-model='studentchangeSysOrgCode.studentStatus' placeholder='请选择状态'
                                   dictCode='student_status' />
              </a-form-model-item>


<!--              //更新班级、学年、学期、班级：更新关系表的时候会把历史数据更新掉，是不正确的。需要精确更新-->
<!--              //知道旧的学期和学年，然后根据旧的学期学年精确查到想要更改的数据，然后进行更改-->
<!--              <a-form-model-item label="新班级"  prop="gradeId">-->
<!--                <j-dict-select-tag @change="changeStudentNewGradeId" type="list" v-model="studentchangeSysOrgCode.gradeId"-->
<!--                                   dictCode='cou_grade,grade_name,id,tenant_id  is not null order by  grade_order'-->
<!--                                   placeholder="年级" style="width: 40%"/>-->
<!--                <j-dict-select-tag type="list" v-model="studentchangeSysOrgCode.classId"-->
<!--                                   :dictCode="this.queryParamSelect.studentNewClassIdSelect"-->
<!--                                   placeholder="班级" style="width: 60%"/>-->
<!--              </a-form-model-item>-->

<!--              <a-form-model-item label='新学年' prop='studentchangeSysOrgCode.schoolYearId'>-->
<!--                <s-dict-select-tag v-model='studentchangeSysOrgCode.schoolYearId' placeholder='请选择学年'-->
<!--                                   dictCode='cou_school_year,school_year_nickname,id,iz_open=1 order by  school_year_code desc' />-->

<!--              </a-form-model-item>-->
<!--              <a-form-model-item label='新学期' prop='studentchangeSysOrgCode.semesterId'>-->
<!--                <s-dict-select-tag v-model='studentchangeSysOrgCode.semesterId' placeholder='请选择学期'-->
<!--                                   dictCode='cou_semester,semester_name,id,tenant_id is not null order by  semester_code' />-->

<!--              </a-form-model-item>-->


            </a-col>
          </a-row>
        </a-modal>
      </div>

    </div>

    <!-- table区域-begin -->
    <div>
      <div class='ant-alert ant-alert-info' style='margin-bottom: 16px;'>
        <i class='anticon anticon-info-circle ant-alert-icon'></i> 已选择 <a
        style='font-weight: 600'>{{ selectedRowKeys.length }}</a>项
        <a style='margin-left: 24px' @click='onClearSelected'>清空</a>
      </div>

      <a-table
        id="datatable"
        ref='table'
        size='middle'
        :scroll='{x:true}'
        bordered
        rowKey='id'
        :columns='columns'
        :dataSource='dataSource'
        :pagination='ipagination'
        :loading='loading'
        :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
        class='j-table-force-nowrap'
        @change='handleTableChange'>

        <template slot='htmlSlot' slot-scope='text'>
          <div v-html='text'></div>
        </template>
        <template slot='imgSlot' slot-scope='text'>
          <span v-if='!text' style='font-size: 12px;font-style: italic;'>无图片</span>
          <img v-else :src='getImgView(text)' height='25px' alt=''
               style='max-width:80px;font-size: 12px;font-style: italic;' />
        </template>
        <template slot='fileSlot' slot-scope='text'>
          <span v-if='!text' style='font-size: 12px;font-style: italic;'>无文件</span>
          <a-button
            v-else
            :ghost='true'
            type='primary'
            icon='download'
            size='small'
            @click='downloadFile(text)'>
            下载
          </a-button>
        </template>

        <span slot='action' slot-scope='text, record'>
          <a @click='handleEdit(record)'>编辑</a>

          <a-divider type='vertical' />
          <a-dropdown>
            <a class='ant-dropdown-link'>更多 <a-icon type='down' /></a>
            <a-menu slot='overlay'>
              <a-menu-item>
                <a @click='handleDetail(record)'>详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>

      </a-table>
    </div>

    <stu-student-modal ref='modalForm' @ok='modalFormOk'></stu-student-modal>
  </a-card>
</template>

<script>

import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import StuStudentModal from './modules/StuStudentModal'
import { downFile, getAction, postAction } from '@api/manage'


export default {
  name: 'StuStudentList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    StuStudentModal
  },
  data() {
    return {
      description: 'stu_student管理页面',
      // 表头
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '所属部门',
          align: 'center',
          dataIndex: 'sysOrgCode_dictText'
        },
        {
          title: '年级',
          align: 'left',
          dataIndex: 'gradeId_dictText'
        },
        {
          title: '班级',
          align: 'left',
          dataIndex: 'classId_dictText'
        },
        {
          title: '学生姓名',
          align: 'center',
          dataIndex: 'studentName'
        },
        {
          title: '考号(学号)',
          align: 'center',
          dataIndex: 'studentNo'
        },
        {
          title: '学籍号',
          align: 'center',
          dataIndex: 'studentNationalityNo'
        },
        {
          title: '登录账号',
          align: 'center',
          dataIndex: 'userId_dictText'
        },
        {
          title: '身份证号',
          align: 'center',
          dataIndex: 'studentIdCardNo'
        },
        {
          title: '卡号',
          align: 'center',
          dataIndex: 'studentCardNo'
        },
        {
          title: '学生性别',
          align: 'center',
          dataIndex: 'studentGender_dictText'
        },
        {
          title: '出生年月',
          align: 'center',
          dataIndex: 'studentDateBirth',
          customRender: function(text) {
            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
          }
        },
        {
          title: '民族',
          align: 'center',
          dataIndex: 'studentNation_dictText'
        },
        {
          title: '联系电话',
          align: 'center',
          dataIndex: 'studentTelephone'
        },
        {
          title: '入学年份',
          align: 'center',
          dataIndex: 'studentEnrollmentYear_dictText'
        },
        {
          title: '学年',
          align: 'center',
          dataIndex: 'schoolYearId_dictText'
        },
        {
          title: '学期',
          align: 'center',
          dataIndex: 'semesterId_dictText'
        },
        {
          title: '学生微信',
          align: 'center',
          dataIndex: 'studentWechat'
        },
        {
          title: '学生邮箱',
          align: 'center',
          dataIndex: 'studentEmail'
        },
        {
          title: '学生QQ',
          align: 'center',
          dataIndex: 'studentQq'
        },
        {
          title: '身高',
          align: 'center',
          dataIndex: 'studentHeight'
        },
        {
          title: '体重',
          align: 'center',
          dataIndex: 'studentWeight'
        },
        {
          title: '视力',
          align: 'center',
          dataIndex: 'studentVision'
        },
        {
          title: '来源学校',
          align: 'center',
          dataIndex: 'studentFromSchool'
        },
        {
          title: '毕业去向',
          align: 'center',
          dataIndex: 'studentGraduationDestination'
        },
        {
          title: '户籍地址',
          align: 'center',
          dataIndex: 'studentHouseholdRegister'
        },
        {
          title: '生源地',
          align: 'center',
          dataIndex: 'studentPlaceOrigin'
        },
        {
          title: '现住地址',
          align: 'center',
          dataIndex: 'studentCurrentAddress'
        },
        {
          title: '学生类型',
          align: 'center',
          dataIndex: 'studentTtype_dictText'
        },
        {
          title: '家庭状态',
          align: 'center',
          dataIndex: 'studentFamilyStatus_dictText'
        },
        {
          title: '是否贫困生',
          align: 'center',
          dataIndex: 'studentPoor_dictText'
        },
        {
          title: '贫困级别',
          align: 'center',
          dataIndex: 'studentPoorLevel_dictText'
        },
        {
          title: '是否借读生',
          align: 'center',
          dataIndex: 'studentLoan_dictText'
        },
        {
          title: '特殊标识',
          align: 'center',
          dataIndex: 'studentSpecialFlag'
        },
        {
          title: '紧急联系人',
          align: 'center',
          dataIndex: 'studentEmergencyContact'
        },
        {
          title: '紧急人联系电话',
          align: 'center',
          dataIndex: 'studentEmergencyTelephone'
        },
        {
          title: '学生状态',
          align: 'center',
          dataIndex: 'studentStatus_dictText'
        },
        {
          title: '排序号',
          align: 'center',
          dataIndex: 'studentOrder'
        },
        {
          title: '是否启用',
          align: 'center',
          dataIndex: 'studentIzOpen_dictText'
        },
        // {
        //   title:'学校编码',
        //   align:"center",
        //   dataIndex: 'tenantId'
        // },
        {
          title: '是否删除',
          align: 'center',
          dataIndex: 'studentIzDelete_dictText'
        },
        {
          title: '备注',
          align: 'center',
          dataIndex: 'studentRemark'
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 147,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/student/stuStudent/list',
        listBatchNumber: '/student/stuStudent/listBatchNumber',
        delete: '/student/stuStudent/delete',
        deleteBatch: '/student/stuStudent/deleteBatch',
        exportXlsUrl: '/student/stuStudent/exportXls',
        exportXlsDemoUrl: '/student/stuStudent/exportXlsDemo',
        importExcelUrl: 'student/stuStudent/importExcelDemo',
        addUsersUrl: '/student/stuStudent/addUsers',
        changeSysOrgCodeUrl: '/student/stuStudent/changeSysOrgCode'

      },
      dictOptions: {},
      superFieldList: [],
      //创建学生登录用户
      studentAddUsers: {
        stupassword: 'Qinghai123.'
      },
      addUsersVisible: false,
      //调整学生部门
      studentchangeSysOrgCode: {
        ids: null,
        sysOrgCode: null
      },
      changeSysOrgCodeVisible: false,
      batchNumbers: [],
      isPinYin: false,
      queryParamSelect: {
        ignorePropertyList: [
          {label: '学年', value: '1'},
          {label: '学期', value: '2'},
          {label: '部门', value: '3'},
          {label: '届级', value: '4'}
        ],
      }
    }
  },
  created() {
    this.getSuperFieldList()
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  mounted() {
    this.initBatchNumber();
  },
  methods: {
    initBatchNumber() {
      var params = {}//查询条件
      getAction(this.url.listBatchNumber, params).then((res) => {
        if (res.success) {

          res.result.forEach(item => {
            if (item.batchNumber) {
              let datas = {
                value: item.batchNumber,
                label: item.batchNumber
              }
              this.batchNumbers.push(datas)
            }
          })
        } else {
          this.$message.warning(res.message)
        }
      })
    },
    handleExportXlsDemo(fileName) {
      if (!fileName || typeof fileName != 'string') {
        fileName = '导出文件'
      }
      let param = {}
      downFile(this.url.exportXlsDemoUrl, param).then((data) => {
        if (!data) {
          this.$message.warning('文件下载失败')
          return
        }
        if (typeof window.navigator.msSaveBlob !== 'undefined') {
          window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
        } else {
          let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
          let link = document.createElement('a')
          link.style.display = 'none'
          link.href = url
          link.setAttribute('download', fileName + '.xls')
          document.body.appendChild(link)
          link.click()
          document.body.removeChild(link) //下载完成移除元素
          window.URL.revokeObjectURL(url) //释放掉blob对象
        }
      })
    },
    initDictConfig() {
    },
    changeGradeId() {
      if (this.queryParam.gradeId) { //判断不为空
        this.queryParamSelect.classIdSelect = 'cou_class,class_name,id,class_iz_open  =1 and class_iz_delete  = 0 and grade_code=\'' + this.queryParam.gradeId + '\' order by  class_order'
      }
    },
    changeStudentNewGradeId() {
      if (this.studentchangeSysOrgCode.gradeId) { //判断不为空
        this.queryParamSelect.studentNewClassIdSelect = 'cou_class,class_name,id,class_iz_open  =1 and class_iz_delete  = 0 and grade_code=\'' + this.studentchangeSysOrgCode.gradeId + '\' order by  class_order'
      }
    },
    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'studentNo', text: '学生学号' })
      fieldList.push({ type: 'string', value: 'studentName', text: '学生姓名' })
      fieldList.push({ type: 'string', value: 'studentIdCardNo', text: '身份证号' })
      fieldList.push({ type: 'int', value: 'studentGender', text: '学生性别' })
      fieldList.push({ type: 'date', value: 'studentDateBirth', text: '出生年月' })
      fieldList.push({ type: 'int', value: 'studentNation', text: '民族' })
      fieldList.push({ type: 'string', value: 'studentTelephone', text: '联系电话' })
      fieldList.push({ type: 'string', value: 'studentEnrollmentYear', text: '入学年份' })
      fieldList.push({ type: 'string', value: 'studentWechat', text: '学生微信' })
      fieldList.push({ type: 'string', value: 'studentEmail', text: '学生邮箱' })
      fieldList.push({ type: 'string', value: 'studentQq', text: '学生QQ' })
      fieldList.push({ type: 'number', value: 'studentHeight', text: '身高' })
      fieldList.push({ type: 'number', value: 'studentWeight', text: '体重' })
      fieldList.push({ type: 'number', value: 'studentVision', text: '视力' })
      fieldList.push({ type: 'string', value: 'studentFromSchool', text: '来源学校' })
      fieldList.push({ type: 'string', value: 'studentGraduationDestination', text: '毕业去向' })
      fieldList.push({ type: 'string', value: 'studentHouseholdRegister', text: '户籍地址' })
      fieldList.push({ type: 'string', value: 'studentPlaceOrigin', text: '生源地' })
      fieldList.push({ type: 'string', value: 'studentCurrentAddress', text: '现住地址' })
      fieldList.push({ type: 'int', value: 'studentTtype', text: '学生类型（1正常升学，2留级，3跳级）' })
      fieldList.push({ type: 'int', value: 'studentFamilyStatus', text: '家庭状态（1正常，2离异，3单亲(丧)，4孤）' })
      fieldList.push({ type: 'int', value: 'studentPoor', text: '是否贫困生' })
      fieldList.push({ type: 'int', value: 'studentPoorLevel', text: '贫困级别' })
      fieldList.push({ type: 'int', value: 'studentLoan', text: '是否借读生' })
      fieldList.push({ type: 'int', value: 'studentSpecialFlag', text: '特殊标识' })
      fieldList.push({ type: 'string', value: 'studentEmergencyContact', text: '紧急联系人' })
      fieldList.push({ type: 'string', value: 'studentEmergencyTelephone', text: '紧急人联系电话' })
      fieldList.push({ type: 'int', value: 'studentStatus', text: '学生状态(1正常，2休学，3退学，4转出，5转入，6毕业）' })
      fieldList.push({ type: 'number', value: 'studentOrder', text: '排序号' })
      fieldList.push({ type: 'int', value: 'studentIzOpen', text: '是否启用' })
      fieldList.push({ type: 'string', value: 'tenantId', text: '学校编码' })
      fieldList.push({ type: 'int', value: 'studentIzDelete', text: '是否删除' })
      this.superFieldList = fieldList
    },
    addUsers() {
      if (this.selectionRows.length === 0) {
        alert('请先选择数据')
      } else {
        //填充新的几项基本信息（试卷编码，试卷名称，所属考试，试卷类型）
        console.log(this.selectionRows)
        var ids = ''
        for (var a = 0; a < this.selectedRowKeys.length; a++) {
          ids += this.selectedRowKeys[a] + ','
        }
        // let addUserParm = { ids: ids,stupassword: this.studentAddUsers.stupassword,  }

        postAction(this.url.addUsersUrl, { ids: ids, stupassword: this.studentAddUsers.stupassword }).then(res => {
          if (res.code === 200) {
            this.$message.success('学生账号添加成功')
          } else {
            this.$message.error('学生账号添加出错，请联系管理员')
          }
        })
      }

      this.addUsersVisible = false
    },
    addUsersVisibleCancel() {
      this.addUsersVisible = false
    },
    //批量调整部门
    changeSysOrgCode() {
      if (this.selectionRows.length === 0) {
        alert('请先选择数据')
      } else {
        //填充新的几项基本信息（试卷编码，试卷名称，所属考试，试卷类型）
        console.log(this.selectionRows)
        var ids = ''
        for (var a = 0; a < this.selectedRowKeys.length; a++) {
          ids += this.selectedRowKeys[a] + ','
        }
        // let addUserParm = { ids: ids,stupassword: this.studentAddUsers.stupassword,  }
        this.studentchangeSysOrgCode.ids = ids;

        postAction(this.url.changeSysOrgCodeUrl,  this.studentchangeSysOrgCode).then(res => {
          if (res.code === 200) {
            this.$message.success('调整部门信息成功')
          } else {
            this.$message.error('调整部门信息出错，请联系管理员')
          }
        })
      }

      this.changeSysOrgCodeVisible = false
    },
    changeSysOrgCodeVisibleCancel() {
      this.changeSysOrgCodeVisible = false
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>